#pragma once
#include "WmarkServer.h"
#include <log/log.h>
#include "BufManager.h"
#include "FreetypeWrapper.h"
#include "WMarkConfig.h"

#define MEM_200KB 204800

using vendor::mega::hardware::common::mega_camera_enhancement::server::implementation::WmarkServer;
using vendor::mega::hardware::common::mega_camera_enhancement::server::V1_0::WmarkPicture;
using vendor::mega::hardware::common::mega_camera_enhancement::server::V1_0::WmarkText;

using ::android::hardware::hidl_array;
using ::android::hardware::hidl_memory;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::sp;

namespace android::wmark
{
    class Server : public WmarkServer
    {
    private:
        Return<void> init(int32_t bufNum) override;
        Return<void> updatePicture(const WmarkPicture& picture) override;
        Return<void> updateText(const WmarkText& text) override;
        Return<void> release() override;

        BufManager *mBufManager;
        FreetypeWrapper *mFreetype;

        int sendText(const WmarkText& text);
        int sendPng(const WmarkPicture& picture);
    public:
        Server(/* args */);
        ~Server();
    };
}
